trait Logger {
  def log(message: String): Unit = println(message)
}

class Calculator extends Logger {
  def add(x: Int, y: Int): Int = {
    val result = x + y
    log(s"Addition operation: $x + $y = $result")
    result
  }

  def subtract(x: Int, y: Int): Int = {
    val result = x - y
    log(s"Subtraction operation: $x - $y = $result")
    result
  }
}

val calculator = new Calculator()
calculator.add(5, 3) // Addition operation: 5 + 3 = 8
// res0: Int = 8

calculator.subtract(5, 3) // Subtraction operation: 5 - 3 = 2
// res1: Int = 2
